# -*- coding: utf-8 -*-
# @Time: 2021/8/19 14:28
# @File: arg-27.py
# @DESC: https://leetcode-cn.com/problems/remove-element/
# 移除元素

def func1(nums, val):
    print()
    flag = 0
    lent = len(nums)
    for i in range(flag, lent):
        print(nums[i])
        if nums[i] - val != 0:
            nums[flag] = nums[i]
            flag += 1
    return flag


nums = [3, 2, 2, 3]
r = func1(nums, 3)
print(r)
